home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / ds3100.md / dc7085.h < prev    next >
C/C++ Source or Header  |  1989-07-08  |  4KB  |  159 lines

  1. /* 
  2.  *  dc7085.h --
  3.  *
  4.  *         Definitions for the dc7085 chip.
  5.  *
  6.  * Copyright (C) 1989 by Digital Equipment Corporation, Maynard MA
  7.  *
  8.  *            All Rights Reserved
  9.  *
  10.  * Permission to use, copy, modify, and distribute this software and its 
  11.  * documentation for any purpose and without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and that
  13.  * both that copyright notice and this permission notice appear in 
  14.  * supporting documentation, and that the name of Digital not be
  15.  * used in advertising or publicity pertaining to distribution of the
  16.  * software without specific, written prior permission.  
  17.  *
  18.  * Digitial disclaims all warranties with regard to this software, including
  19.  * all implied warranties of merchantability and fitness.  In no event shall
  20.  * Digital be liable for any special, indirect or consequential damages or
  21.  * any damages whatsoever resulting from loss of use, data or profits,
  22.  * whether in an action of contract, negligence or other tortious action,
  23.  * arising out of or in connection with the use or performance of this
  24.  * software.
  25.  *
  26.  * $Header: dc7085.h,v 1.2 89/06/20 11:11:59 mnelson Exp $ SPRITE (DECWRL)
  27.  */
  28.  
  29. /*
  30.  * Define the six registers.
  31.  */
  32. extern volatile unsigned short *devCSRPtr;
  33. extern volatile unsigned short *devRBufPtr;
  34. extern volatile unsigned short *devLPRPtr;
  35. extern volatile unsigned short *devTCRPtr;
  36. extern volatile unsigned short *devMSRPtr;
  37. extern volatile unsigned short *devTDRPtr;
  38.  
  39. /*
  40.  * Control status register bits.
  41.  */
  42. #define    CSR_TRDY    0x8000
  43. #define CSR_TIE        0x4000
  44. #define    CSR_TX_LINE_NUM    0x0300
  45. #define    CSR_RDONE    0x0080
  46. #define    CSR_RIE        0x0040
  47. #define CSR_MSE        0x0020
  48. #define CSR_CLR        0x0010
  49. #define CSR_MAINT    0x0008
  50.  
  51. /*
  52.  * Receiver buffer register bits.
  53.  */
  54. #define    RBUF_DVAL        0x8000
  55. #define RBUF_OERR        0x4000
  56. #define RBUF_FERR        0x2000
  57. #define RBUF_PERR        0x1000
  58. #define RBUF_LINE_NUM        0x0300
  59. #define RBUF_LINE_NUM_SHIFT    8
  60. #define RBUF_CHAR        0x00FF
  61.  
  62. /*
  63.  * Line parameter register bits.
  64.  */
  65. #define    LPR_RXENAB    0x1000
  66. #define    LPR_B4800    0x0C00
  67. #define LPR_B9600    0x0E00
  68. #define LPR_OPAR    0x0080
  69. #define LPR_PARENB    0x0040
  70. #define LPR_2_STOP    0x0020
  71. #define LPR_8_BIT_CHAR    0x0018
  72. #define LPR_7_BIT_CHAR    0x0010
  73. #define LPR_6_BIT_CHAR    0x0008
  74. #define LPR_5_BIT_CHAR    0x0000
  75.  
  76. /*
  77.  * The four serial ports.
  78.  */
  79. #define    KBD_PORT    0
  80. #define MOUSE_PORT    1
  81. #define MODEM_PORT    2
  82. #define PRINTER_PORT    3
  83.  
  84. /*
  85.  * Special key values.
  86.  */
  87. #define KEY_SHIFT    0xae
  88. #define KEY_CONTROL    0xaf
  89. #define KEY_UP        0xb3
  90. #define KEY_REPEAT    0xb4
  91. #define KEY_F13        0x73
  92.  
  93. /*
  94.  * Command characters for the mouse.
  95.  */
  96. #define MOUSE_SELF_TEST        'T'
  97. #define MOUSE_INCREMENTAL    'R'
  98.  
  99. /*
  100.  * Mouse output bits.
  101.  *
  102.  *         MOUSE_START_FRAME    Start of report frame bit.
  103.  *    MOUSE_X_SIGN        Sign bit for X.
  104.  *    MOUSE_Y_SIGN        Sign bit for Y.
  105.  *    MOUSE_X_OFFSET        X offset to start cursor at.
  106.  *    MOUSE_Y_OFFSET        Y offset to start cursor at.
  107.  */
  108. #define MOUSE_START_FRAME    0x80
  109. #define MOUSE_X_SIGN        0x10
  110. #define MOUSE_Y_SIGN        0x08
  111. #define    MOUSE_X_OFFSET        212
  112. #define    MOUSE_Y_OFFSET         34
  113.  
  114. /* 
  115.  * Definitions for mouse buttons
  116.  */
  117. #define RIGHT_BUTTON        0x01
  118. #define MIDDLE_BUTTON        0x02
  119. #define LEFT_BUTTON        0x04
  120.  
  121. #define MOTION_BUFFER_SIZE 100
  122.  
  123. /* 
  124.  * Mouse report structure definition
  125.  */
  126. typedef struct {
  127.     char state;            /* buttons and sign bits    */
  128.     short dx;            /* delta X since last change    */
  129.     short dy;            /* delta Y since last change    */
  130.     char byteCount;            /* mouse report byte count    */
  131. } MouseReport;
  132.  
  133. /* 
  134.  * Lk201/301 keyboard
  135.  */
  136. #define LK_UPDOWN    0x86        /* bits for setting lk201 modes */
  137. #define LK_AUTODOWN    0x82
  138. #define LK_DOWN        0x80
  139. #define LK_DEFAULTS    0xd3        /* reset (some) default settings*/
  140. #define LK_AR_ENABLE    0xe3        /* global auto repeat enable    */
  141. #define LK_CL_ENABLE    0x1b        /* keyclick enable        */
  142. #define LK_KBD_ENABLE    0x8b        /* keyboard enable        */
  143. #define LK_BELL_ENABLE    0x23        /* the bell            */
  144. #define LK_LED_ENABLE    0x13        /* light led            */
  145. #define LK_LED_DISABLE    0x11        /* turn off led            */
  146. #define LK_RING_BELL    0xa7        /* ring keyboard bell        */
  147. #define LED_1        0x81        /* led bits            */
  148. #define LED_2        0x82
  149. #define LED_3        0x84
  150. #define LED_4        0x88
  151. #define LED_ALL        0x8f
  152. #define LK_KDOWN_ERROR    0x3d        /* key down on powerup error    */
  153. #define LK_POWER_ERROR    0x3e        /* keyboard failure on pwrup tst*/
  154. #define LK_OUTPUT_ERROR 0xb5        /* keystrokes lost during inhbt */
  155. #define LK_INPUT_ERROR    0xb6        /* garbage command to keyboard    */
  156. #define LK_LOWEST    0x56        /* lowest significant keycode    */
  157.  
  158.  
  159.